﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PENet;
using System.Collections.Generic;

namespace TestProject
{
    [TestClass]
    public class TestUnit
    {
        [TestMethod]
        public void TestGetDosHeader()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            PEStructures.IMAGE_DOS_HEADER dos= penet.DOSHeader;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetNTHeader()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            PEStructures.IMAGE_NT_HEADERS nt = penet.NTHeader;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetSectionHeader()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            PEStructures.IMAGE_SECTION_HEADER_RECORD[] h = penet.SectionHeader;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetSectionData()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            List<byte[]> v = penet.SectionData;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetCodeSectionData()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            byte[] cs = penet.CodeSectionData;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetDebug()
        {
            PENet.PENet penet = new PENet.PENet("d:\\test.exe");
            PEStructures.IMAGE_DEBUG_DIRECTORY[] db = penet.DebugTable;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetExport()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_EXPORT_DIRECTORY exp = penet.ExportTable;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetImport()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_IMPORT_DIRECTORY im = penet.ImportTable;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetException()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_EXCEPTION exp = penet.ExceptionTable;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetRelocation()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_RELOCATION_ENTRY[] rel = penet.RelocationTable;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetTls()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_TLS_DIRECTORY tls = penet.TLS;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetLoadCfg()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_LOAD_CONFIG_DIRECTORY ld = penet.LoadConfigDirectory;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetCLR()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_CLR clr = penet.CLRDirectory;
            Console.WriteLine("done...!");
        }

        [TestMethod]
        public void TestGetRsrc()
        {
            PENet.PENet penet = new PENet.PENet("d:\\dll.dll");
            PEStructures.IMAGE_RESOURCE_DIRECTORY rsc = penet.ResourceDirectory;
            Console.WriteLine("done...!");
        }
    }
}
